package com.zf.shuashua.ui.mine.notice;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseViewHolder;
import com.meis.base.mei.adapter.MeiBaseAdapter;
import com.zf.shuashua.R;
import com.zf.shuashua.bean.MessageLoveList;

import java.util.List;

public class MessageLoveListAdapter extends MeiBaseAdapter<MessageLoveList.DataBean> {

    public MessageLoveListAdapter(int layoutResId, @Nullable List<MessageLoveList.DataBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(final BaseViewHolder helper, final MessageLoveList.DataBean item) {
        if(item == null || item.getData() == null){
            return;
        }
        MessageLoveList.DataBean.DateBean.NewsBean news = item.getData().getNews();
        if(news == null){
            return;
        }
        helper.setText(R.id.tvUserName, news.getUser_name())
                .setText(R.id.tvReplyContent, news.getShowTypeText())
                .setText(R.id.tvTime, item.getTime());
        Glide.with(mContext)
                .load(news.getUser_avatar())
                .circleCrop()
                .into((ImageView) helper.getView(R.id.imgAvatar));
        Glide.with(mContext)
                .load(news.getVideo_avatar())
                .into((ImageView) helper.getView(R.id.imgFeed));
    }
}